package com.example.mrzhou.lvmm.presenter.home;

import com.example.mrzhou.lvmm.entity.home.HomeTitle;
import com.example.mrzhou.lvmm.model.ModelFactory;
import com.example.mrzhou.lvmm.view.impl.home.HomeTitleView;

import rx.Subscriber;

/**
 * Created by Mr.zhou on 2016/10/28.
 */

public class HomeTitlePresenter {
    private HomeTitleView homeTitleView;

    public HomeTitlePresenter(HomeTitleView homeTitleView) {
        this.homeTitleView = homeTitleView;
    }

    public void getHomeTitle(){
        ModelFactory.getiHomeModel().getHomeTitle(new Subscriber<HomeTitle>() {
            @Override
            public void onCompleted() {
                homeTitleView.onFinsh();
            }

            @Override
            public void onError(Throwable e) {
                homeTitleView.onFaiure(e);
            }

            @Override
            public void onNext(HomeTitle homeTitle) {
                homeTitleView.onSuccess(homeTitle);
            }
        });
    }
}
